package Nisha;


public class ArithmeticOperations {

	//http://listverse.com/2007/09/17/10-easy-arithmetic-tricks/
	
/*public boolean isDividedBy11(int number)
{
	
}*/

/* method returns the square of a 2 digit number which ends by 5*/

public static int MultiplyBy5(int number)
{
	int temp = number/2,i=0;
	//System.out.println(temp);
	while(temp!=0)
	{ 
		temp = temp/10;
		i++;		
	}
	//System.out.println(i);
	return (int) ((number%2==0)?(number/2)*Math.pow(10,i-1):((number/2)*Math.pow(10,i-1))+5);
}
	
/* method returns the square of any number*/

public static int QuickSquare(int number)
{
	return ((number/10)*(number/10+1))*100+25;
}


public static int MultiplyBy9(int number)
{
	
	return ((number-1)*10)+ (9-number+1);
}


public static int MultiplyBy4(int number)
{
	
	return (number*2)+(number*2);
}

public static double CalculateATip(double number)
{
	
	return (number/10)+((number/20));
}

public static double DividingBy5(int number)
{
	
	return (number*2)/10;
}


	public static void main(String[] args) {
	 
		System.out.println(QuickSquare(25));
		System.out.println(MultiplyBy5(30));
		System.out.println(MultiplyBy9(4));
		System.out.println(MultiplyBy4(4));
		System.out.println(CalculateATip(25));
		System.out.println(DividingBy5(122));
	}

}
